{include 'admin/layout/header_list'}
<link rel="stylesheet" href="__ADMIN_STATIC__/css/plugin.css?random={extendSetting('random')}">
<div class="ltcms_container">
    <div class="container_title">
        <form action="{LTCMS_ROUTE_PREFIX}/adManage/index" method="get" class="ltcms_search">
            <input name="positionId" type="text" placeholder="请输入广告位ID" {if isset($request['positionId'])} value="{$request['positionId']}" {/if} >
            <input name="name" type="text" placeholder="请输入广告名称" {if isset($request['name'])} value="{$request['name']}" {/if} >
            <button type="submit" class="btn3">搜索</button>
        </form>
    </div>
    <section class="ltcms_content">
        <div class="ltcms_list">
            <table class="list_table">
                <colgroup>
                    <col width="40px" >
                    <col width="100px" >
                    <col width="150px" >
                    <col width="90px" >
                    <col width="150px" >
                    <col width="80px" >
                    <col width="180px" >
                    <col width="80px" >
                    <col >
                </colgroup>
                <tr>
                    <td class="th"><input id="selectAll" type="checkbox"></td>
                    <td class="th">id</td>
                    <td class="th">名称</td>
                    <td class="th">广告类型</td>
                    <td class="th">广告位</td>
                    <td class="th">排序</td>
                    <td class="th">有效期</td>
                    <td class="th">数据</td>
                    <td class="th">操作</td>
                </tr>
                {if $rowData}
                {foreach $rowData["data"] $key $val}
                <tr class="tr">
                    <td><input class="checkbox" name="check_id" type="checkbox" value="{$val['id']}"></td>
                    <td>{$val["id"]}</td>
                    <td title="{$val['link']}" >{$val["name"]}</td>
                    <td>{$val["typeFormat"]}</td>
                    <td>{$adManageKeyVal?$adManageKeyVal[$val["positionId"]]:$val["positionId"]}</td>
                    <td>{$val["sortWeights"]}</td>
                    <td>{$val["startTimeFormat"]} - {$val["endTimeFormat"]}</td>
                    <td>{if $val['type']=="1"}<img onclick="scale_img(this)" src="{$val['content']}" style="max-width:50px;max-height:40px;"  />{/if}</td>
                    <td>
                        <div class="btn4">
                            <a href="{LTCMS_ROUTE_PREFIX}/adManage/edit?id={$val['id']}">
                                <i title="编辑"  alt="" class='btn4-img iconfont icon-bianji'></i>
                            </a>
                            <i onClick="runApi(this)" title="删除"  data-close="4" data-submit-url="{LTCMS_ROUTE_PREFIX}/adManage?id={$val['id']}" data-method="delete" alt="" class="btn4-img del iconfont icon-delete"></i>
                        </div>
                    </td>
                </tr>
                {/foreach}
                {/if}
            </table>
        </div>
    </section>
    <div class="list-bottom">
        <div class="bottom-left">
            <a href="{LTCMS_ROUTE_PREFIX}/adManage"><button class="btn2 trash">添加</button></a>
            <button class="btn2 del1" onclick="dataMoreDel(this)" data-close="3" data-submit-url="{LTCMS_ROUTE_PREFIX}/adManage?id=" data-method="delete"  >彻底删除</button>
        </div>
        <div class="pages">
            {if $rowData}
            {php echo app("P_page")->getPageBarV2($rowData);}
            {/if}
        </div>
    </div>
</div>

<script src="__ADMIN_STATIC__/js/list.js?random={extendSetting('random')}"></script>
{include 'admin/layout/footer'}